package com.xy.biz.xd.domain.converter;

import java.util.Collection;
import java.util.List;

import com.xy.biz.xd.domain.req.DocumentFlowCancelRequestFlowRequest;
import com.xy.tool.util.BeanUtilsEx;
import com.xy.biz.xd.domain.bo.DocumentFlowCancelRequestFlowBO;
import com.xy.biz.xd.domain.po.DocumentFlowCancelRequestFlowPO;
import com.xy.biz.xd.domain.query.DocumentFlowCancelRequestFlowQuery;
import com.xy.biz.xd.domain.resp.GetDocumentFlowCancelRequestFlowResponse;
import com.xy.biz.xd.domain.req.SaveDocumentFlowCancelRequestFlowRequest;
import com.xy.biz.xd.domain.req.ListDocumentFlowCancelRequestFlowRequest;

/**
 * 
 * 
 * @author zgy
 * @date 2021-6-17
 */
public class DocumentFlowCancelRequestFlowConverter {
	
	public static DocumentFlowCancelRequestFlowPO toPO(DocumentFlowCancelRequestFlowBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new DocumentFlowCancelRequestFlowPO(), true);
	}
	
	public static List<DocumentFlowCancelRequestFlowPO> toPO(Collection<DocumentFlowCancelRequestFlowBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentFlowCancelRequestFlowPO(), true);
	}
	
	public static DocumentFlowCancelRequestFlowBO fromPO(DocumentFlowCancelRequestFlowPO source) {
		return BeanUtilsEx.copyProperties(source, () -> new DocumentFlowCancelRequestFlowBO());
	}
	
	public static List<DocumentFlowCancelRequestFlowBO> fromPO(Collection<DocumentFlowCancelRequestFlowPO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentFlowCancelRequestFlowBO());
	}
	
	public static DocumentFlowCancelRequestFlowBO toBO(SaveDocumentFlowCancelRequestFlowRequest source) {
		return BeanUtilsEx.copyProperties(source, () -> new DocumentFlowCancelRequestFlowBO(), true);
	}

	public static DocumentFlowCancelRequestFlowBO toBO(DocumentFlowCancelRequestFlowRequest source) {
		return BeanUtilsEx.copyProperties(source, () -> new DocumentFlowCancelRequestFlowBO(), true);
	}
	
	public static List<DocumentFlowCancelRequestFlowBO> toBO(Collection<SaveDocumentFlowCancelRequestFlowRequest> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentFlowCancelRequestFlowBO(), true);
	}
	
	public static GetDocumentFlowCancelRequestFlowResponse toResponse(DocumentFlowCancelRequestFlowBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new GetDocumentFlowCancelRequestFlowResponse());
	}
	
	public static List<GetDocumentFlowCancelRequestFlowResponse> toResponse(Collection<DocumentFlowCancelRequestFlowBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new GetDocumentFlowCancelRequestFlowResponse());
	}
	
	public static DocumentFlowCancelRequestFlowQuery toQuery(ListDocumentFlowCancelRequestFlowRequest source) {
		if(null == source) {
			return null;
		}
		DocumentFlowCancelRequestFlowQuery target = new DocumentFlowCancelRequestFlowQuery(source.getPageIndex(), source.getPageSize());
		BeanUtilsEx.copyProperties(source, target);
		return target;
	}

}
